package Fangfalianxi;
//复制数组
//需求：把一个数组中的元素复制到另一个新数组中去
public class test4 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6};
        int[] newarr = new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            newarr[i] = arr[i];
        }
        for (int i = 0; i < newarr.length; i++) {
            System.out.print(newarr[i]+" ");
        }
    }
}
